package com.nettyRpc.consumer;

import io.netty.channel.Channel;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * interface com.nettyRpc.api.IHelloService \[id: 0x3f770713, L:/127.0.0.1:58188 - R:/127.0.0.1:8088]
 */
public class DubboProxy {
    public <T> T client(Class clazz, Channel channel) {
        InvocationHandler invocationHandler = new DubboInvoke(clazz, channel);
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, invocationHandler);
    }
}
